home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / cursos2.h < prev    next >
C/C++ Source or Header  |  1993-06-17  |  7KB  |  293 lines

  1. /* $Header: C:\CURSES\RCS\cursos2.h 2.1 1993/06/18 20:18:48 MH Rel MH $ */
  2. #ifndef CURSOS2_INCL
  3. #define CURSOS2_INCL 1
  4.  
  5. #ifdef CURSES__32BIT__
  6.  
  7. #if (NOVIO)
  8. #define KbdSetStatus Kbd32SetStatus
  9. #define KbdGetStatus Kbd32GetStatus
  10. #define KbdCharIn Kbd32CharIn
  11. #define KbdPeek   Kbd32Peek
  12. #define KbdFlushBuffer Kbd32FlushBuffer
  13.  
  14. #define VioGetMode Vio32GetMode
  15. #define VioSetMode Vio32SetMode
  16. #define VioGetCurPos Vio32GetCurPos
  17. #define VioSetCurPos Vio32SetCurPos
  18. #define VioGetCurType Vio32GetCurType
  19. #define VioSetCurType Vio32SetCurType
  20. #define VioScrollDn Vio32ScrollDn
  21. #define VioScrollUp Vio32ScrollUp
  22. #define VioGetConfig Vio32GetConfig
  23. #define VioWrtTTY Vio32WrtTTY
  24. #define VioReadCellStr Vio32ReadCellStr
  25. #define VioWrtCellStr Vio32WrtCellStr
  26. #define VioWrtNAttr Vio32WrtNAttr
  27. #endif   /*  NOVIO */
  28.  
  29. #define FARKeyword
  30.  
  31. #define CURS_INCL_VIO_KBD
  32.  
  33.  
  34. #ifdef __EMX__
  35. #  ifndef USE_OS2_H
  36. #     define USE_OS2_H
  37. #  endif
  38. #  define APIENTRY
  39. #else
  40. #  define APIRET ULONG
  41. #endif
  42.  
  43. #else
  44.  
  45.  
  46. #   define FARKeyword far
  47. #   define APIRET USHORT
  48.  
  49. #ifdef USE_OS2_H
  50. #   define INCL_VIO
  51. #   define INCL_KBD
  52. #else
  53. #   define CURS_INCL_VIO_KBD
  54. #endif
  55.  
  56.  
  57. #endif   /* __32BIT__ */
  58.  
  59.  
  60. /* if USE_OS2_H is defined then use the os2.h that comes with your compiler ...*/
  61.  
  62. #ifdef USE_OS2_H
  63. #  include <os2.h>
  64. #else
  65.  
  66. /* ... otherwise use these definitions */
  67.  
  68. #  include <os2def.h>
  69.  
  70. #endif
  71.  
  72. #ifdef CURS_INCL_VIO_KBD
  73.  
  74. typedef SHANDLE         HKBD;
  75. typedef HKBD    FARKeyword *   PHKBD;
  76.  
  77.  
  78. typedef SHANDLE         HVIO;
  79. typedef HVIO    FARKeyword *   PHVIO;
  80.  
  81.  
  82.  
  83. typedef struct _KBDINFO {
  84.         USHORT cb;
  85.         USHORT fsMask;
  86.         USHORT chTurnAround;
  87.         USHORT fsInterim;
  88.         USHORT fsState;
  89.         }KBDINFO;
  90. typedef KBDINFO FARKeyword *PKBDINFO;
  91.  
  92.  
  93. USHORT APIENTRY KbdSetStatus(
  94.         PKBDINFO    pkbdinfo,
  95.         HKBD        hkbd );
  96.  
  97.  
  98. USHORT APIENTRY KbdGetStatus(
  99.         PKBDINFO    pkbdinfo,
  100.         HKBD        hdbd  );
  101.  
  102.  
  103. typedef struct _KBDKEYINFO {
  104.         UCHAR    chChar;    /* ASCII character code                     */
  105.         UCHAR    chScan;    /* Scan Code                                */
  106.         UCHAR    fbStatus;
  107.         UCHAR    bNlsShift;
  108.         USHORT   fsState;
  109.         ULONG    time;
  110.         }KBDKEYINFO;
  111. typedef KBDKEYINFO FARKeyword *PKBDKEYINFO;
  112.  
  113. #define IO_WAIT     0
  114. #define IO_NOWAIT   1
  115.  
  116. USHORT APIENTRY KbdCharIn(
  117.         PKBDKEYINFO pkbci,
  118.         USHORT      fWait,      /* IO_WAIT, IO_NOWAIT     */
  119.         HKBD        hkbd);
  120.  
  121. USHORT APIENTRY KbdPeek(
  122.         PKBDKEYINFO  pkbci,
  123.         HKBD         hkbd );
  124.  
  125. USHORT APIENTRY KbdFlushBuffer(
  126.         HKBD hkbd);
  127.  
  128.  
  129. typedef struct _VIOMODEINFO {
  130.         USHORT cb;
  131.         UCHAR  fbType;
  132.         UCHAR  color;
  133.         USHORT col;     /* number of text columns                       */
  134.         USHORT row;     /* number of text rows                          */
  135.         USHORT hres;    /* horizontal resolution                        */
  136.         USHORT vres;    /* vertical resolution                          */
  137.         UCHAR  fmt_ID;
  138.         UCHAR  attrib;  /* number of attributes                         */
  139.         ULONG  buf_addr;
  140.         ULONG  buf_length;
  141.         ULONG  full_length;
  142.         ULONG  partial_length;
  143.         PCH    ext_data_addr;
  144.         } VIOMODEINFO;
  145. typedef VIOMODEINFO FARKeyword *PVIOMODEINFO;
  146.  
  147.  
  148. USHORT APIENTRY VioGetMode(
  149.         PVIOMODEINFO  pvioModeInfo,
  150.         HVIO          hvio);
  151.  
  152.  
  153. USHORT APIENTRY VioSetMode(
  154.         PVIOMODEINFO  pvioModeInfo,
  155.         HVIO          hvio);
  156.  
  157.  
  158. USHORT APIENTRY VioGetCurPos(
  159.         PUSHORT    pusRow,
  160.         PUSHORT    pusColumn,
  161.         HVIO       hvio );
  162.  
  163.  
  164. USHORT APIENTRY VioSetCurPos(
  165.         USHORT  usRow,
  166.         USHORT  usColumn,
  167.         HVIO    hvio);
  168.  
  169. typedef struct _VIOCURSORINFO {
  170.         USHORT   yStart;
  171.         USHORT   cEnd;
  172.         USHORT   cx;
  173.         USHORT   attr;   /* -1=hidden cursor, any other=normal cursor   */
  174.         } VIOCURSORINFO;
  175. typedef VIOCURSORINFO FARKeyword *PVIOCURSORINFO;
  176.  
  177.  
  178. USHORT APIENTRY VioGetCurType(
  179.        PVIOCURSORINFO pvioCursorInfo,
  180.        HVIO           hvio );
  181.  
  182.  
  183. USHORT APIENTRY VioSetCurType(
  184.         PVIOCURSORINFO pvioCursorInfo,
  185.         HVIO           hvio );
  186.  
  187. USHORT APIENTRY VioScrollDn(
  188.         USHORT  usTopRow,
  189.         USHORT  usLeftCol,
  190.         USHORT  usBotRow,
  191.         USHORT  usRightCol,
  192.         USHORT  cbLines,
  193.         PBYTE   pCell,
  194.         HVIO    hvio );
  195.  
  196.  
  197.  
  198. USHORT APIENTRY VioScrollUp(
  199.         USHORT  usTopRow,
  200.         USHORT  usLeftCol,
  201.         USHORT  usBotRow,
  202.         USHORT  usRightCol,
  203.         USHORT  cbLines,
  204.         PBYTE   pCell,
  205.         HVIO    hvio );
  206.  
  207.  
  208.    /* VIOCONFIGINFO.adapter constants */
  209.  
  210.    #define DISPLAY_MONOCHROME      0x0000
  211.    #define DISPLAY_CGA             0x0001
  212.    #define DISPLAY_EGA             0x0002
  213.    #define DISPLAY_VGA             0x0003
  214.    #define DISPLAY_8514A           0x0007
  215.  
  216.    /* VIOCONFIGINFO.display constants */
  217.  
  218.    #define MONITOR_MONOCHROME      0x0000
  219.    #define MONITOR_COLOR           0x0001
  220.    #define MONITOR_ENHANCED        0x0002
  221.    #define MONITOR_8503            0x0003
  222.    #define MONITOR_851X_COLOR      0x0004
  223.    #define MONITOR_8514            0x0009
  224.  
  225. typedef struct _VIOCONFIGINFO {
  226.         USHORT  cb;
  227.         USHORT  adapter;
  228.         USHORT  display;
  229.         ULONG   cbMemory;
  230.         USHORT  Configuration;
  231.         USHORT  VDHVersion;
  232.         USHORT  Flags;
  233.         ULONG   HWBufferSize;
  234.         ULONG   FullSaveSize;
  235.         ULONG   PartSaveSize;
  236.         USHORT  EMAdaptersOFF;
  237.         USHORT  EMDisplaysOFF;
  238.         } VIOCONFIGINFO;
  239. typedef VIOCONFIGINFO FARKeyword *PVIOCONFIGINFO;
  240.  
  241.  
  242. USHORT APIENTRY VioGetConfig(
  243.         USHORT         usConfigId,  /* Reserved (must be 0)             */
  244.         PVIOCONFIGINFO pvioin,
  245.         HVIO           hvio );
  246.  
  247. USHORT APIENTRY VioWrtTTY(
  248.         PCH     pch,
  249.         USHORT  cb,
  250.         HVIO    hvio );
  251.  
  252. USHORT APIENTRY VioReadCellStr(
  253.         PCH       pchCellStr,
  254.         PUSHORT   pcb,
  255.         USHORT    usRow,
  256.         USHORT    usColumn,
  257.         HVIO      hvio );
  258.  
  259. USHORT APIENTRY VioWrtCellStr(
  260.         PCH      pchCellStr,
  261.         USHORT   cb,
  262.         USHORT   usRow,
  263.         USHORT   usColumn,
  264.         HVIO     hvio );
  265.  
  266. USHORT APIENTRY VioWrtNAttr(
  267.         PBYTE     pAttr,
  268.         USHORT    cb,
  269.         USHORT    usRow,
  270.         USHORT    usColumn,
  271.         HVIO      hvio );
  272.  
  273.  
  274. USHORT APIENTRY VioWrtNCell(
  275.         PBYTE   pCell,
  276.         USHORT  cb,
  277.         USHORT  usRow,
  278.         USHORT  usColumn,
  279.         HVIO    hvio );
  280.  
  281. #endif
  282.  
  283. #endif
  284.  
  285.  
  286. #ifndef KEYBOARD_ASCII_MODE
  287. #define KEYBOARD_ASCII_MODE 0x0008
  288. #endif
  289.  
  290. #ifndef KEYBOARD_BINARY_MODE
  291. #define KEYBOARD_BINARY_MODE 0x0004
  292. #endif
  293.